﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ninject;
using sdm.exam.domain.Abstract;
using sdm.exam.domain.Entities;

namespace sdm.exam.domain.DataContext
{
    public class StudyPlanDomain
    {
        private readonly ISdmExamRepository _repository = null;
        public StudyPlanDomain()
        {
            _repository = Ninjector.Kernel.Get<ISdmExamRepository>();
        }

        public bool AddStudyPlan(Studyplan studyplan)
        {
            //var studyplan = new Studyplan { Courses = courseList, SemesterClass = semesterClass, IsAssignedToSemesterClass = p};
            try
            {
                _repository.Studyplans.Add(studyplan);
                _repository.SaveChanges();
                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
    }
}
